<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getContextPath();
	String path = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+basePath+"/";
	request.setAttribute("path",path);
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
	<meta name="format-detection" content="telephone=no,address=no,email=no"/>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<title>故事简介</title>
	<script type="text/javascript" src="js/jquery1.12.js"></script>
	<link href="css/style.css" rel="stylesheet" media="all">
	<link rel="shortcut icon" href="img/favicon.png">
	<script type="text/javascript">
		function togglePraise(themeId){
			$.get("./kaToggelePraise?themeId="+themeId, function(data,status){
				var jsonData = JSON.parse(data); 
			    var msg;
			    if(jsonData.mystatus == -1) {
			   
				var msg = confirm("登录后才可以点赞");
				    if(msg==true){
				    	window.location.href="./kaPersonal";
				    	return;
				    }
			    }
			    else if(jsonData.mystatus == 0) {
			    	msg = "您取消了点赞"; 
			    	$("#totalPraise").html(jsonData.total);
			    }else if(jsonData.mystatus == 1){ 
			    	msg = "您点赞成功";
			    	$("#totalPraise").html(jsonData.total);
			    }
			    
			  });
		}
	</script>
</head>
<body>
	<header class="top_header">
		<h1><a href="javascript:history.go(-1);" class="go_back"></a><a class="share_a"></a></h1>
	</header><!-- header -->
	<div class="content_wrap">
		<div class="kastory_txt">
			<h3>${theme.themeName}</h3>
			<div class="kastory_name">${name}</div>
			${theme.details}
			
			<div class="kastory_liked" onclick="togglePraise(${theme.id});">
				<a class="liked_icon"><img src="img/icon/icon_nz_01.png"></a>
				<span class="yellow_txt" id="totalPraise">${size}</span>人喜欢这个故事
			</div>
		</div><!-- kastory_txt -->
		
		<div class="kasampledet_nav">
			<a href="${path}/kaSampleDet?themeId=${theme.id}">查看详情</a>
		</div><!-- kasampledet_nav -->
		
		
	</div><!-- content_wrap -->
	
	<div class="footer_copyright">
		<p><span>苏州知行合一网络科技有限公司</span>提供技术支持，版权所有</p>
	</div><!-- footer_copyright -->
</body>
</html>